<div>
  <h1><%= writer.name %></h1>
  <p><%= writer.desc %></p>
  <hr>
  
  <br>
  <h4>所有文章类别</h4>
  <% var count = 0; %>
  <%for ( var i in categories ){%>
    <% if (count % 6 === 0) {%>
      <div class="row">
    <%}%>

    <div class="col-md-2">
    <% if (categories.hasOwnProperty(i)){%>
      <% var cat_image = '<img src="' + '/main/images/' + i + '.png' + '"' + ' class="img-rounded">';%>
      <%= cat_image %>
      <br><br>

       <a href="<%= '/article/category/?category=' + i %>&writer=<%= writer.name %>">
         <%= i %><span class="badge"><%= categories[i] %></span>
      </a>

    <%}%>
    </div>

    <!--last one or the one can divide 6, then end one row-->
    <% if ( (count > 5 && count % 6 === 0 ) || count + 1 === categories.length ) {%>
      </div>
    <%}%> 
    <% count = count + 1; %>     
  <%}%>


</div>
<hr>
<br>

